package config

import "model"

type GrowCfg struct {
	PId uint  `gorm:"column:pId"`
	Name string `gorm:"column:name"`
	Grow1 int16 `gorm:"column:grow1"`
	Grow2 int16 `gorm:"column:grow2"`
	Grow3 int16 `gorm:"column:grow3"`
}
type SignCfg struct {
	Day uint `gorm:"column:day"`
	AwardName string `gorm:"column:awardName"`
	AwardNum int16 `gorm:"column:awardNum"`
	AreaId int16 `gorm:"column:areaId"`
	Ctype int8 `gorm:"column:ctype"`
	Gain int8 `gorm:"column:gain"`
}



func GetGrowcfg(pId uint) *GrowCfg{
	var Db = model.DB("FarmConfig")
	defer Db.Close();
	var g GrowCfg
	if err:=Db.Where(&GrowCfg{PId:pId}).First(&g).Error;err!=nil{
		return nil
	}else{
		return &g
	}

}
